import pool from '@/server/db'

export default defineEventHandler(async () => {
  try {
    const sql = 'SELECT * FROM users'
    const [result, fields] = await pool.query(sql)
    return {
      result,
      fields
    }
  } catch (err) {
    console.log(err)
  }
})